// 区域管理接口
import request from '@/utils/request'
// import { getUser, getToken } from '@/utils/auth'
import qs from 'qs'

export function getSectionList(data, stationId) {
  if (!stationId) stationId = data.stationId || '0'
  return request({
    url: '/section/page/by/station/' + stationId,
    method: 'post',
    data
  })
}

// 添加区域
export function addSection(data) {
  return request({
    url: '/section/add',
    method: 'post',
    data
  })
}

// 修改区域
export function putSection(data) {
  return request({
    url: '/section/edit',
    method: 'post',
    data
  })
}

// 删除区域
export function delSection(data) {
  return request({
    url: '/section/delete/' + data.sectionId,
    method: 'delete',
    headers: { 'content-type': 'application/x-www-form-urlencoded' },
    data: qs.stringify(data)
  })
}
